package cn.school.controller;


import cn.school.dto.PaperDetailDto;
import cn.school.dto.UpdatePaperDetailDto;
import cn.school.service.PaperDetailService;
import cn.school.vo.PaperDetailVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/paperDetail")
public class PaperDetailController {
    @Resource
    private PaperDetailService paperDetailService;
    @RequestMapping("/detail")
    public String addDetail(@RequestBody PaperDetailDto paperDetailDto, HttpServletRequest request){
        String message= paperDetailService.addDetail(paperDetailDto,request);
        return message;
    }
    @RequestMapping("/findPaperDetail")
    public List<PaperDetailVo> findPaperDetail(String paperId){
        List<PaperDetailVo> list=paperDetailService.findPaperDetail(paperId);
        return list;
    }
    @RequestMapping("/updatePaperDetail")
    public String updatePaperDetail(@RequestBody UpdatePaperDetailDto updatePaperDetailDto, HttpServletRequest request){
        String message= paperDetailService.updatePaperDetail(updatePaperDetailDto,request);
        return message;
    }
}
